<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>print</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="prepiano.html" title="prepiano" />
    <link rel="next" href="printf.html" title="printf" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">print</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="prepiano.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="printf.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="print"></a>
      <div class="titlepage"></div>
      <a id="IndexPrint" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">print</span>
        </h2>
        <p>print — 
      Displays the values init (i-rate) variables.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp135702640"></a>
        <h2>Description</h2>
        <p>
      These units will print orchestra init-values.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp135745408"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>print</strong></span> iarg [, iarg1] [, iarg2] [...]</pre>
      </div>
      <div class="refsect1">
        <a id="idp135747472"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>iarg, iarg2, ... </em></span> -- i-rate arguments.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp135749120"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>print</em></span> -- print the current value of the i-time arguments (or expressions) <span class="emphasis"><em>iarg</em></span> at every i-pass through the instrument.
    </p>
        <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="images/note.png" />
              </td>
              <th align="left">Note</th>
            </tr>
            <tr>
              <td align="left" valign="top">
                <p>
        The <span class="emphasis"><em>print</em></span> opcode will truncate decimal places and may not show the complete value. Csound's precision depends on whether it is the floats (32-bit) or double (64-bit) <a class="link" href="MiscCsound64.html" title="Appendix H. Csound Double (64-bit) vs. Float (32-bit)"><em class="citetitle">version</em></a>, since most internal calculations use one of these formats. If you need more resolution in the console output, you can try <a class="link" href="printf.html" title="printf"><em class="citetitle">printf</em></a>.
      </p>
              </td>
            </tr>
          </table>
        </div>
      </div>
      <div class="refsect1">
        <a id="idp135754816"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the print opcode. It uses the file <a class="ulink" href="examples/print.csd" target="_top"><em class="citetitle">print.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp135756672"></a>
          <p class="title">
            <strong>Example 649. Example of the print opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
-odac    <span class="comment">;;;realtime audio out</span>
<span class="comment">;-iadc    ;;;uncomment -iadc if realtime audio input is needed too</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o print.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">ksmps</span> <span class="op">=</span> 32
<span class="ohdr">nchnls</span> <span class="op">=</span> 2
<span class="ohdr">0dbfs</span>  <span class="op">=</span> 1

<span class="oblock">instr</span> 1

irand <span class="op">=</span> <span class="opc">rnd</span>(3)			<span class="comment">;generate a random number from 0 to 3</span>
<span class="opc">print</span> irand			<span class="comment">;print it</span>
asig  <span class="opc">poscil</span> .7, 440<span class="op">*</span>irand, 1
      <span class="opc">outs</span> asig, asig

<span class="oblock">endin</span>
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="stamnt">f</span>1 0 16384 10 1	<span class="comment">;sine wave</span>

<span class="stamnt">i</span> 1 0 1
<span class="stamnt">i</span> 1 2 1
<span class="stamnt">i</span> 1 4 1
<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
      Its output should include lines like these:
      </p>
        <pre class="screen">
instr 1:  irand = 2.930
instr 1:  irand = 0.420
instr 1:  irand = 2.316
      </pre>
        <p>
    </p>
      </div>
      <div class="refsect1">
        <a id="idp135761760"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="dispfft.html" title="dispfft"><em class="citetitle">dispfft</em></a>,
      <a class="link" href="display.html" title="display"><em class="citetitle">display</em></a>, 
      <a class="link" href="printk.html" title="printk"><em class="citetitle">printk</em></a>,
      <a class="link" href="printk2.html" title="printk2"><em class="citetitle">printk2</em></a>,
      <a class="link" href="printks.html" title="printks"><em class="citetitle">printks</em></a> ,
      <a class="link" href="printf.html" title="printf"><em class="citetitle">printf</em></a> and
      <a class="link" href="prints.html" title="prints"><em class="citetitle">prints</em></a>
    </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="prepiano.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="printf.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">prepiano </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> printf</td>
        </tr>
      </table>
    </div>
  </body>
</html>
